﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Data;

namespace System
{
    public interface IEDal
    {
        int Delete(Hashtable list);
        int Delete(Hashtable list, string tableName);
        int Insert(Hashtable list, string fields);
        int Insert(Hashtable list, string fields, string tableName);
        int InsertOrUpdate(Hashtable list, string fields);
        int InsertOrUpdate(Hashtable list, string fields, string tableName);
        int Update(Hashtable list, string fields);
        int Update(Hashtable list, string fields, string tableName);


        int _Add<Tm>(Dictionary<string, Tm> list, string fields) where Tm : BaseModel, new();       
        int _Add<Tm>(Dictionary<string, Tm> list, string fields, string tableName) where Tm : BaseModel, new();      
        int _Remove<Tm>(Dictionary<string, Tm> list) where Tm : BaseModel, new();
        int _Remove<Tm>(Dictionary<string, Tm> list, string tableName) where Tm : BaseModel, new();       
        int _Modify<Tm>(Dictionary<string, Tm> list, string fields) where Tm : BaseModel, new();       
        int _Modify<Tm>(Dictionary<string, Tm> list, string fields, string tableName) where Tm : BaseModel, new();
        int _AddOrModify<Tm>(Dictionary<string, Tm> list, string fields) where Tm : BaseModel, new();
        int _AddOrModify<Tm>(Dictionary<string, Tm> list, string fields, string tableName) where Tm : BaseModel, new();       
        Dictionary<string, Tm> _GetDicList<Tm>() where Tm : BaseModel, new();
        Dictionary<string, Tm> _GetDicList<Tm>(string sql, List<DBParameter> parameters) where Tm : BaseModel, new();     
        Dictionary<string, Tm> _GetDicList<Tm>(string fields, string filter, string sorts, List<DBParameter> parameters) where Tm : BaseModel, new();      
        Dictionary<string, Tm> _GetDicList<Tm>(int? pageIndex, int? pageSize, ref int? recordCount, string fields, string filter, string sorts, List<DBParameter> parameters) where Tm : BaseModel, new();
        Dictionary<string, Tm> _GetDicList<Tm>(string tableName) where Tm : BaseModel, new();      
        Dictionary<string, Tm> _GetDicList<Tm>(string fields, string filter, string sorts, string tableName, List<DBParameter> parameters) where Tm : BaseModel, new();
        Dictionary<string, Tm> _GetDicList<Tm>(int? pageIndex, int? pageSize, ref int? recordCount, string fields, string filter, string sorts, string tableName, List<DBParameter> parameters) where Tm : BaseModel, new();      
        Dictionary<string, Tm> _GetDicList<Tm>(IDataReader dr) where Tm : BaseModel, new();
        Dictionary<string, Tm> _GetDicList<Tm>(DataTable dt) where Tm : BaseModel, new();     
        Dictionary<string, Tm> _GetDicList<Tm>(DataView dv) where Tm : BaseModel, new();      
        Dictionary<string, Tm> _GetDicList<Tm>(SqlInfo sqlInfo, List<DBParameter> parameters) where Tm : BaseModel, new();
        Dictionary<string, Tm> _GetDicList<Tm>(PageInfo pageInfo, List<DBParameter> parameters) where Tm : BaseModel, new();
    }
}
